package cn.hr.entity;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;


/**
 * 文章栏目实体类
 */
@Entity
@Table(name="tb_catalog"
    ,catalog="hrm"
)

public class Catalog  implements java.io.Serializable {


    // Fields    

     /**
	 * 
	 */
	private static final long serialVersionUID = 2716387376921479110L;
	private Integer id;
     private String catalogName;
     private Integer parentId;
     private Integer sortSign;
     private Set<Article> articles = new HashSet<Article>(0);


    // Constructors

    /** default constructor */
    public Catalog() {
    }

	/** minimal constructor */
    public Catalog(String catalogName, Integer sortSign) {
        this.catalogName = catalogName;
        this.sortSign = sortSign;
    }
    
    /** full constructor */
    public Catalog(String catalogName, Integer parentId, Integer sortSign, Set<Article> articles) {
        this.catalogName = catalogName;
        this.parentId = parentId;
        this.sortSign = sortSign;
        this.articles = articles;
    }

   
    // Property accessors
    @Id @GeneratedValue(strategy=IDENTITY)
    
    @Column(name="id", unique=true, nullable=false)

    public Integer getId() {
        return this.id;
    }
    
    public void setId(Integer id) {
        this.id = id;
    }
    
    @Column(name="catalogName", nullable=false, length=32)

    public String getCatalogName() {
        return this.catalogName;
    }
    
    public void setCatalogName(String catalogName) {
        this.catalogName = catalogName;
    }
    
    @Column(name="parentId")

    public Integer getParentId() {
        return this.parentId;
    }
    
    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }
    
    @Column(name="sortSign", nullable=false)

    public Integer getSortSign() {
        return this.sortSign;
    }
    
    public void setSortSign(Integer sortSign) {
        this.sortSign = sortSign;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="catalog")

    public Set<Article> getArticles() {
        return this.articles;
    }
    
    public void setArticles(Set<Article> articles) {
        this.articles = articles;
    }
   








}